package com.weijia;

import java.awt.*;
import java.util.Random;

public class FallingWord {
    public String word;
    public int x, y;
    public int speed;
    public Color color;

    public FallingWord(String word, int panelWidth, TypingGamePlus.Difficulty difficulty) {
        this.word = word;
        int maxX = panelWidth - 100;
        if (maxX < 0) maxX = 0;
        this.x = new Random().nextInt(maxX + 1);
        this.y = 150;
        this.speed = difficulty.getMinSpeed() + new Random().nextInt(
                difficulty.getMaxSpeed() - difficulty.getMinSpeed() + 1);
        int r = 150 + new Random().nextInt(100);
        int g = 150 + new Random().nextInt(100);
        int b = 200 + new Random().nextInt(55);
        this.color = new Color(r, g, b);
    }
} 